/**
 * @author Vitor Franco do Carmo (vfcarmo@gmail.com)
 * @since 05/10/2013
 *
 */
package br.com.vfcfw.test.functional.browser;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;

/**
 * @author Vitor Franco do Carmo (vfcarmo@gmail.com)
 * @since 05/10/2013
 * 
 */
public class HtmlUnitNavegador implements INavegador {

    private static WebDriver driver;

    /**
     * {@inheritDoc}
     * 
     * @see br.com.vfcfw.test.functional.browser.INavegador#inicializarServico()
     */
    @Override
    public void inicializarServico() {

    }

    /**
     * {@inheritDoc}
     * 
     * @see br.com.vfcfw.test.functional.browser.INavegador#finalizarServico()
     */
    @Override
    public void finalizarServico() {

    }

    /**
     * {@inheritDoc}
     * 
     * @see br.com.vfcfw.test.functional.browser.INavegador#inicializarTeste()
     */
    @Override
    public void inicializarTeste() {

        driver = new HtmlUnitDriver(true);
    }

    /**
     * {@inheritDoc}
     * 
     * @see br.com.vfcfw.test.functional.browser.INavegador#finalizarTeste()
     */
    @Override
    public void finalizarTeste() {

        if (driver != null) {

            driver.close();
        }
    }

    /**
     * {@inheritDoc}
     * 
     * @see br.com.vfcfw.test.functional.browser.INavegador#obterDriver()
     */
    @Override
    public WebDriver obterDriver() {

        return driver;
    }

}
